home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mm / mm-0.90 / mkdefines < prev    next >
Encoding:
AWK Script  |  1990-12-18  |  686 b   |  22 lines

  1. #!/bin/awk -f
  2. # Copyright (c) 1986, 1990 by The Trustees of Columbia University in
  3. # the City of New York.  Permission is granted to any individual or
  4. # institution to use, copy, or redistribute this software so long as it
  5. # is not sold for profit, provided this copyright notice is retained.
  6. #
  7. # $Header: /f/src2/encore.bin/cucca/mm/tarring-it-up/RCS/mkdefines,v 2.1 90/10/04 18:32:58 melissa Exp $
  8.  
  9. BEGIN { n = 0 }
  10. /^#number/    { n = $2; next }
  11. /^#def [A-Za-z]/{ for (i=2; length($i) == 0; i++)
  12.                 ;
  13.           p = sprintf ("#define %-16s %d", $i, n++);
  14.           s = " ";
  15.           while (++i <= NF)
  16.             if (length ($i) > 0)
  17.                 s = s $i " ";
  18.           printf ("%-40s /*%s*/\n", p, s);
  19.           next }
  20.         { print }
  21.  
  22.